﻿<%@ Page Title="Church Services" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyLocalChurch.ChurchServices.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Church Services
    </h2>
    <p>
        <a href="CreateChurchService.aspx">Add New Church Service</a>
    </p>
    <table>
        <thead>
            <tr>
                <th>Day of Week</th>
                <th>Start Time</th>
                <th>Active</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <asp:Repeater ID="rptChurchServices" runat="server">
                <ItemTemplate>
                    <tr>
                        <td><%# DataBinder.Eval(Container.DataItem, "DayOfWeek") %></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "StartTime") %></td>
                        <td><%# bool.Parse(DataBinder.Eval(Container.DataItem, "IsActive").ToString()) ? "active" : "inactive" %></td>
                        <td>
                            <a href="EditChurchService.aspx?Id=<%# DataBinder.Eval(Container.DataItem, "Id") %>">Edit</a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </tbody>
    </table>
</asp:Content>
